home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / COM / ProTERM Mac1.2a.sit / ProTERM Mac1.2a / Macros / Resident User 1201 < prev    next >
Text File  |  1996-07-24  |  11KB  |  526 lines

  1. /**************************************
  2.  *                                    *
  3.  *  ProTERM/Mac Resident User Macros  *
  4.  *                                    *
  5.  *   Version 1201   Updated 5/11/96   *
  6.  *                                    *
  7.  **************************************/
  8. //
  9. // NOTE: Text between '/*' and '*/' and following '//' are comments.
  10. //
  11.  
  12. //
  13. // special "link" code just in case file is executed directly
  14. //
  15. FUNC main()
  16. {
  17.  EXTERN(PREF_GET("mac1"),main(1));
  18.  RETURN;
  19. }
  20.  
  21.  
  22. /***********************************************************************/
  23. /*                   Start of Startup Macros                           */
  24. /***********************************************************************/
  25.  
  26. FUNC startup(STR file)
  27. {
  28.  
  29. //
  30. // Add startup macro variables after this comment
  31. //
  32.  
  33. //
  34. // Add startup macro code after this comment
  35. //
  36.  
  37.  UI_EQUIV("File:Save Asノ","M"); 
  38.  UI_EQUIV("Edit:Format Test","T");
  39.  UI_EQUIV("Edit:Macro Exec","/");
  40.  UI_EQUIV("Edit:Character Count",",");
  41.  UI_EQUIV("Edit:Convert:Paragraph Format","U")
  42.  UI_EQUIV("Edit:Convert:Smart Quotes","J")
  43.  UI_EQUIV("Edit:Convert:Reply Format","Y")
  44.  
  45. // leave this code unchanged
  46.  RESIDENT("",0,#KeyAccess+#LibAccess);
  47.  RETURN;
  48. }
  49.  
  50.  
  51. /***********************************************************************/
  52. /*                   Start of Keyboard Macros                          */
  53. /***********************************************************************/
  54.  
  55.  
  56. //
  57. // COMMAND+OPTION+K: Resize editor window to 80x24
  58. //
  59. FUNC ked_0928()
  60. {
  61.  WIN_SIZE(WIN_ACTIVE(0),80*6+19,24*12+8);
  62.  RETURN;
  63. }
  64.  
  65.  
  66. //
  67. // COMMAND+OPTION+F: Insert First Name into Editor
  68. //
  69. FUNC key_0903()
  70. {
  71.  UI_TYPE(first_name(GESTALT(name)));
  72.  RETURN;
  73. }
  74.  
  75.  
  76. //
  77. // COMMAND+OPTION+N: Insert Name (first+last) into Editor
  78. //
  79. FUNC key_092D()
  80. {
  81.  UI_TYPE(GESTALT(name));
  82.  RETURN;
  83. }
  84.  
  85. //
  86. // COMMAND+OPTION+O: Insert Name @ Org into Editor
  87. //
  88. FUNC key_091F()
  89. {
  90.  UI_TYPE(GESTALT(name)+" @ "+GESTALT(org));
  91.  RETURN;
  92. }
  93.  
  94. //
  95. // COMMAND+OPTION+Y: Auto Reply Format
  96. //
  97. FUNC ked_0910()
  98. {
  99.  UI_MENU("Edit:Convert:Paragraph Format");
  100.  UI_MENU("Edit:Convert:Reply Format");
  101.  UI_CLICK("Format");
  102.  RETURN;
  103.  
  104. //
  105. // F1 macro: Mark Start of Reply Formatting (for Send ASCII)
  106. //
  107. FUNC ked_007A()
  108. {
  109.  UI_TYPE('シre(メ > モ)シ^m');
  110.  RETURN;
  111. }
  112.  
  113.  
  114. //
  115. // F2 macro: Mark End of Reply Formatting (for Send ASCII)
  116. //
  117. FUNC ked_0078()
  118. {
  119.  UI_TYPE('シreシ^m');
  120.  RETURN;
  121. }
  122.  
  123.  
  124. //
  125. // F3 macro: Mark Start of Hanging-Indent Text (for Send ASCII)
  126. //
  127. FUNC ked_0063()
  128. {
  129.  UI_TYPE('シlm3シシpm-2シ^m');
  130.  RETURN;
  131. }
  132.  
  133.  
  134. //
  135. // F4 macro: Mark End of Hanging-Indent Text (for Send ASCII)
  136. //
  137. FUNC ked_0076()
  138. {
  139.  UI_TYPE('シlmシシpmシ^m');
  140.  RETURN;
  141. }
  142.  
  143.  
  144. //
  145. // F5 macro: Delphi Mail Template (for Send ASCII)
  146. //
  147. func ked_0060()
  148. {
  149. UI_TYPE('^
  150. シhideシ
  151. **************************************************************************
  152. The following is a mail template that can be used to automate the sending of mail on Delphi. To use the template, replace the text in all uppercase with the appropriate information. After connecting to Delphi, choose the Send ASCII command in the Edit menu to send the mail. While they may look funny, the commands surrounded by シ are what tell ProTERM how to control Delphi.
  153. **************************************************************************
  154. シshowシ
  155. シasnd($p,メモ)シ
  156. シpr(メmail/s^ Mモ)シ
  157. シwt(メmail>モ)シ
  158. シpr(メsend^ Mモ)シ
  159. シwt(メto:モ)シ
  160. シpr(メPUT_MAIL_ADDRESS_HERE^ Mモ)シ
  161. シwt(メsubj:モ)シ 
  162. シpr(メPUT_MAIL_SUBJECT_HERE^ Mモ)シ
  163. シwt(メquit:モ)シ
  164.  
  165. PUT_MAIL_CONTENTS_HERE
  166.  
  167. シpr (メ^ Zモ)シ
  168. シpr(メexit^ Mモ)シ
  169. ');
  170. RETURN;
  171. }
  172.  
  173.  
  174. //
  175. // F6 macro: GEnie Mail Template (for Send ASCII)
  176. //
  177. FUNC ked_0061()
  178. {
  179. UI_TYPE('^
  180. シhideシ
  181. **************************************************************************
  182. The following is a mail template that can be used to automate the sending of mail on GEnie. To use the template, replace the text in all uppercase with the appropriate information. After connecting to GEnie, choose the Send ASCII command in the Edit menu to send the mail. While they may look funny, the commands surrounded by シ are what tell ProTERM how to control GEnie.
  183. **************************************************************************
  184. シshowシ
  185. シasnd($p,メモ)シ
  186. シpr(メm200;9^ Mモ)シ
  187. シwt(メand?モ)シ
  188. シpr(メtba^ Mモ)シ
  189. シwt(メputモ)シ
  190. シrm80シ
  191. PUT_MAIL_ADDRESS_HERE
  192. PUT_MAIL_CC_HERE_OR_LEAVE_BLANK
  193. PUT_MAIL_SUBJECT_HERE
  194.  
  195. PUT_MAIL_CONTENTS_HERE
  196.  
  197. *s
  198. シpr(メ^ Cモ)シ
  199. シwt(メand?モ)シ
  200. シpr(メexit^ Mモ)シ
  201. シwt(メ>モ)シ
  202. ');
  203. RETURN;
  204. }
  205.  
  206.  
  207. //
  208. // F7 macro: GEnie Internet Mail Template (for Send ASCII)
  209. //
  210. FUNC ked_0062()
  211. {
  212. UI_TYPE('^
  213. シhideシ
  214. **************************************************************************
  215. The following is a mail template that can be used to automate the sending of internet mail on GEnie. To use the template, replace the text in all uppercase with the appropriate information. After connecting to GEnie, choose the Send ASCII command in the Edit menu to send the mail. While they may look funny, the commands surrounded by シ are what tell ProTERM how to control GEnie.
  216. **************************************************************************
  217. シshowシ
  218. シasnd($p,メ>モ)シ
  219. シpr(メm207;3^ Mモ)シ
  220. シwt(メ^ J>モ)シ
  221. シpr(メPUT_INTERNET_MAIL_ADDRESS_HERE^ Mモ)シ
  222. シwt(メ^ J>モ)シ
  223. シpr(メ^ Mモ)シ
  224. シwt(メ^ J>モ)シ
  225. シpr(メ^ Mモ)シ
  226. シwt(メ >モ)シ
  227. シpr(メn^ Mモ)シ
  228. シwt(メ^ J>モ)シ
  229. シpr(メPUT_MAIL_SUBJECT_HERE^ Mモ)シ
  230. シwt(メ  1>モ)シ
  231.  
  232. PUT_MAIL_CONTENTS_HERE
  233.  
  234. シpr(メ*s^ Mモ)シ
  235. シwt(メ>モ)シ
  236. ');
  237. RETURN;
  238. }
  239.  
  240. //
  241. // F8 macro: CIS Mail Template (for Send ASCII)
  242. //
  243. FUNC ked_0064()
  244. {
  245. UI_TYPE('^
  246. シhideシ
  247. **************************************************************************
  248. The following is a mail template that can be used to automate the sending of mail on CompuServe. To use the template, replace the text in all uppercase with the appropriate information. After connecting to CompuServe, choose the Send ASCII command in the Edit menu to send the mail. While they may look funny, the commands surrounded by シ tell ProTERM how to control CompuServe.
  249. **************************************************************************
  250. シshowシ
  251. シasnd($p,メ:モ)シ
  252. シpr(メgo mail^ Mモ)シ
  253. シwt (メchoice!モ)シ
  254. comp
  255. to: PUT_MAIL_ADDRESS_HERE
  256. from: PUT_YOUR_NAME_HERE
  257. subj: PUT_MAIL_SUBJECT_HERE
  258.  
  259. PUT_MAIL_CONTENTS_HERE
  260.  
  261. シpr(メ/exit^ mメ)シ
  262. send
  263. yes
  264. ');
  265. RETURN;
  266. }
  267.  
  268. //
  269. // F9 macro: CIS Internet Mail Template (for Send ASCII)
  270. //
  271. FUNC ked_0065()
  272. {
  273. UI_TYPE('^
  274. シhideシ
  275. **************************************************************************
  276. The following is a mail template that can be used to automate the sending of internet mail on CompuServe. To use the template, replace the text in all uppercase with the appropriate information. After connecting to CompuServe, choose the Send ASCII command in the Edit menu to send the mail. While they may look funny, the commands surrounded by シ are what tell ProTERM how to control CompuServe.
  277. **************************************************************************
  278. シshowシ
  279. シasnd($p,メ:モ)シ
  280. シpr(メgo mail^ Mモ)シ
  281. シwt (メchoice!モ)シ
  282. comp
  283. to: name id: >internet:PUT_INTERNET_MAIL_ADDRESS_HERE
  284. from: PUT_YOUR_NAME_HERE
  285. subj: PUT_MAIL_SUBJECT_HERE
  286.  
  287. PUT_MAIL_CONTENTS_HERE
  288.  
  289. シpr(メ/exit^ mメ)シ
  290. send
  291. yes
  292. ');
  293. RETURN;
  294. }
  295.  
  296. //
  297. // F10 macro
  298. //
  299. FUNC ked_006D()
  300. {
  301.  UI_TYPE('^
  302. You can edit this macro and make it insert whatever text you want by
  303. changing the file "Resident Macros" located in the Extras folder.
  304. ');
  305.  RETURN;
  306. }
  307.  
  308. //
  309. // F11 macro
  310. //
  311. FUNC ked_0067()
  312. {
  313.  UI_TYPE('^
  314. Simple keyboard macros are a powerful way
  315. to quickly enter frequently used text.
  316. ');
  317.  RETURN;
  318. }
  319.  
  320. //
  321. // F12 macro
  322. //
  323. FUNC ked_006F()
  324. {
  325.  UI_TYPE('The F12 keyboard macro is unused.^m');
  326.  RETURN;
  327. }
  328.  
  329. //
  330. // F13 macro
  331. //
  332. FUNC ked_0069()
  333. {
  334.  UI_TYPE('The F13 keyboard macro is unused.^m');
  335.  RETURN;
  336. }
  337.  
  338. //
  339. // F14 macro
  340. //
  341. FUNC ked_006B()
  342. {
  343.  UI_TYPE('The F14 keyboard macro is unused.^m');
  344.  RETURN;
  345. }
  346.  
  347. //
  348. // F15 macro
  349. //
  350. FUNC ked_0071()
  351. {
  352.  UI_TYPE('The F15 keyboard macro is unused.^m');
  353.  RETURN;
  354. }
  355.  
  356.  
  357. /***********************************************************************/
  358. /*                   Start of Library Macros                           */
  359. /***********************************************************************/
  360.  
  361.  
  362. //
  363. // Return First Name (from full name)
  364. //
  365. FUNC first_name(STR name)
  366. {
  367.  RETURN(STR_LEFT(name,STR_INDEX(" ",name)));
  368. }
  369.  
  370. //
  371. // zoom window back to user size
  372. //
  373. FUNC zoom_user()
  374.  WIN_ZOOM(WIN_ACTIVE(0),"-"));
  375.  RETURN;
  376. }
  377.  
  378. //
  379. // zoom window to default size
  380. //
  381. FUNC zoom_default()
  382.  WIN_ZOOM(WIN_ACTIVE(0),"+"));
  383.  RETURN;
  384. }
  385.  
  386. //
  387. // zoom window to minimum size
  388. //
  389. FUNC zoom_min()
  390.  WIN_ZOOM(WIN_ACTIVE(0),"<"));
  391.  RETURN;
  392. }
  393.  
  394. //
  395. // zoom window to maximum size
  396. //
  397. FUNC zoom_max()
  398.  WIN_ZOOM(WIN_ACTIVE(0),">"));
  399.  RETURN;
  400. }
  401.  
  402. //
  403. // zoom window to maximum vertical
  404. //
  405. FUNC zoom_vert()
  406.  WIN_ZOOM(WIN_ACTIVE(0),"{"));
  407.  RETURN;
  408. }
  409.  
  410. //
  411. // zoom window to maximum horizontal
  412. //
  413. FUNC zoom_horiz()
  414.  WIN_ZOOM(WIN_ACTIVE(0),"}"));
  415.  RETURN;
  416. }
  417.  
  418.  
  419. /***********************************************************************/
  420. /*                   Start of Event Macros                             */
  421. /***********************************************************************/
  422.  
  423.  
  424. //
  425. // Sample "connect event" macro
  426. //
  427. FUNC ev_conn(INT ses, STR term, STR name, INT numb, INT time)
  428. {
  429.  PRINTF("ev_conn()^m");
  430.  PRINTF("session = $%x^m",ses);
  431.  PRINTF("term = %s^m",term);
  432.  PRINTF("name = %s^m",name);
  433.  PRINTF("numb = %s^m",numb);
  434.  PRINTF("time = %D %T^m",time,time);
  435.  RETURN;
  436. }
  437.  
  438.  
  439. //
  440. // Sample "xfer event" macro
  441. //
  442. FUNC ev_xfer(INT ses, STR mode, STR proto, INT time, INT ticks, INT cur, INT max, STR path, STR name, INT len, INT mod, INT type, INT create, INT bytes, INT spent, INT cps, STR opts, INT errs, STR result)
  443. {
  444.  PRINTF("ev_xfer()^m");
  445.  PRINTF("session = $%x^m",ses);
  446.  PRINTF("mode = %s^m",mode);
  447.  PRINTF("proto = %s^m",proto);
  448.  PRINTF("time = %D %T^m",time,time);
  449.  PRINTF("ticks = %d^m",ticks);
  450.  PRINTF("cur = %d^m",cur);
  451.  PRINTF("max = %d^m",max);
  452.  PRINTF("file path = %s^m",path);
  453.  PRINTF("file name = %s^m",name);
  454.  PRINTF("file len = %d^m",len);
  455.  PRINTF("file modified = %D %T^m",mod,mod);
  456.  PRINTF("file type = '%P'^m",type);
  457.  PRINTF("file creator = '%P'^m",create);
  458.  PRINTF("bytes = %d^m",bytes);
  459.  PRINTF("spent = %S^m",spent);
  460.  PRINTF("cps = %d^m",cps);
  461.  PRINTF("opts = %s^m",opts);
  462.  PRINTF("errs = %d^m",errs);
  463.  PRINTF("result = %s^m",result);
  464.  RETURN;
  465. }
  466.  
  467.  
  468. /***********************************************************************/
  469. /*                  Example Macro Window                               */
  470. /***********************************************************************/
  471.  
  472.  
  473. //
  474. // COMMAND+OPTION+E: Open macro window
  475. //
  476. FUNC key_090E()
  477. {
  478.  LOCAL INT win;
  479.  
  480.  IF (WIN_FIND("Dot-Cmds")) {
  481.   RETURN;
  482.  }
  483.  
  484.  win = WIN_OPEN("Dot-Cmds", 1, -87, 83);
  485.  WIN_BUTTON(win, 1, "reply-start");
  486.  WIN_BUTTON(win, 2, "reply-end  ");
  487.  WIN_BUTTON(win, 3, "hanging    ");
  488.  WIN_BUTTON(win, 4, "flush      ");
  489.  
  490.  WIN_MACRO(win, 1, メedit_win('シre(ヤ > ユ)シ^m');モ);
  491.  WIN_MACRO(win, 2, メedit_win('シreシ^m');モ);
  492.  WIN_MACRO(win, 3, メedit_win('シlm5シシpm-3シ^m');モ);
  493.  WIN_MACRO(win, 4, メedit_win('シlmシシpmシ^m');モ);
  494.  RETURN;
  495. }
  496.  
  497. //
  498. // callback function used by window routines
  499. //
  500. FUNC edit_win(STR cmd)
  501. {
  502.  IF (WIN_TYPE(WIN_ACTIVE(0)) == 'EDIT') {
  503.   UI_TYPE(cmd);
  504.  }
  505.  RETURN;
  506. }
  507.  
  508. FUNC ref_test(INT xxx, yyy)
  509. {
  510.  str_parse("567","%d",xxx);
  511.  str_parse("123","%d",yyy);
  512.  xxx = yyy + 3;
  513.  
  514.  
  515.  RETURN(xxx);
  516. }
  517.  
  518.  
  519.